﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.IsoParametricCurves.CUiIsoParametricCurvesEnabler
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using Tecnomatix.Engineering;
using Tecnomatix.Planning;


namespace DnProcessSimulateCommands.IsoParametricCurves;

public class CUiIsoParametricCurvesEnabler : ITxCommandEnabler
{
  ~CUiIsoParametricCurvesEnabler()
  {
  }

  public bool Enable => this.CheckSelectedIsPartOrResourceInModeling();

  private bool CheckSelectedIsPartOrResourceInModeling()
  {
    bool flag = false;
    TxObjectList allItems = TxApplication.ActiveSelection.GetAllItems();
    if (((Collection<ITxObject>) allItems).Count == 1)
    {
      TxComponent txComponent = ((Collection<ITxObject>) allItems)[0] as TxComponent;
      if (TxComponent.op_Inequality(txComponent, (ITxObject) null) && txComponent.RepresentationType == 6 && (txComponent.PlanningRepresentation is TxPlanningPart || txComponent.PlanningRepresentation is TxPlanningResource))
        flag = true;
    }
    return flag;
  }
}
